package com.yzt.dynamicmodule.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.LoadMoreModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.yzt.zhuju.network.entity.game.GameUserListBean;
import com.yzt.zhuju.widget.tuiview.TUIImageView;
import com.yzt.zhuju.widget.widget.ImageLoadManger;
import com.yzt.dynamicmodule.R;
import com.yzt.plugin_widget.RoundImageView;

/**
 * author : bob
 * date   : 2023/2/27
 * desc   : 动态的适配器
 */
public class ActivityDetailUserAdapter extends BaseQuickAdapter<GameUserListBean, BaseViewHolder> implements LoadMoreModule {

    public ActivityDetailUserAdapter() {
        super(R.layout.item_activity_activity_join_user);
    }

    @Override
    protected void convert(BaseViewHolder holder, GameUserListBean item) {

        RoundImageView imgHeader = holder.findView(R.id.img_header);
        ImageLoadManger.loadIv(getContext(), item.getAvatar(), imgHeader, R.mipmap.default_photo);

        TUIImageView imgGender = holder.findView(R.id.img_gender);
        imgGender.setSelected(item.getGender() == 0);

        holder.setText(R.id.tv_name, item.getNickName());

        holder.setVisible(R.id.img_host, item.isEmcee());
    }
}